//
//  XmoBorderView.m
//  XmoStickerView
//
//  Created by Tracy on 16/3/23.
//  Copyright © 2016年 yule. All rights reserved.
//

#import "XmoBorderView.h"
static CGFloat kXmoUserResizableViewInteractiveBorderSize = 10.0f;
@implementation XmoBorderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}
- (void)drawRect:(CGRect)rect{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSaveGState(context);
    CGContextSetLineWidth(context, 2.0f);
    CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:1.000 green:0.851 blue:0.089 alpha:1.000].CGColor);
    CGContextAddRect(context, CGRectInset(self.bounds, kXmoUserResizableViewInteractiveBorderSize/2, kXmoUserResizableViewInteractiveBorderSize/2));
    CGContextStrokePath(context);
    CGContextRestoreGState(context);
    CGContextRelease(context);
}
@end
